package com.zt.bus.line.model;

import java.io.Serializable;

import com.zt.system.model.BusinessException;
import com.zt.system.model.Entity;

import net.sf.json.JSONObject;

public class Vehicle extends Entity implements Serializable {
    private String id;

    private String vehicleNo;
    
    private String vehicleName;

    private int seatNum;

    private String vehicleType;

    private static final long serialVersionUID = 1L;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getVehicleNo() {
        return vehicleNo;
    }

    public void setVehicleNo(String vehicleNo) {
        this.vehicleNo = vehicleNo;
    }

    public int getSeatNum() {
        return seatNum;
    }

    public void setSeatNum(int seatNum) {
        this.seatNum = seatNum;
    }

    public String getVehicleType() {
        return vehicleType;
    }

    public void setVehicleType(String vehicleType) {
        this.vehicleType = vehicleType;
    }
    
    public JSONObject toJson(Vehicle vehicle){
    	if(vehicle == null){
    		throw new BusinessException("转换参数错误");
    	}
    	JSONObject json = new JSONObject();
    	json.put("vehicleNo", vehicle.getVehicleNo());
    	json.put("seatNum", vehicle.getSeatNum());
    	json.put("vehicleName", vehicle.getVehicleName());
    	json.put("vehicleType", vehicle.getVehicleType());
    	return json;
    }

	public String getVehicleName() {
		return vehicleName;
	}

	public void setVehicleName(String vehicleName) {
		this.vehicleName = vehicleName;
	}
}